Socket
Socket
Sign inDemoInstall

empower-core

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empower-core

Power Assert feature enhancer for assert function/object


Version published
Weekly downloads
191K
decreased by-8.5%
Maintainers
1
Weekly downloads
 
Created

What is empower-core?

The empower-core npm package is a core library for power-assert, which provides a way to enhance assertion libraries by adding descriptive assertion messages. It is designed to work with various assertion libraries to provide more informative error messages, making it easier to debug test failures.

What are empower-core's main functionalities?

Enhanced Assertion Messages

This feature allows you to enhance the standard assertion messages with more descriptive information. In the example, the assertion `enhancedAssert(result === 5, 'Expected result to be 5')` will provide a more detailed error message if the assertion fails.

const assert = require('assert');
const empower = require('empower-core');
const enhancedAssert = empower(assert);

function add(a, b) {
  return a + b;
}

const result = add(2, 2);
enhancedAssert(result === 5, 'Expected result to be 5');

Customizable Assertion Formatting

This feature allows you to customize the formatting of assertion messages. By providing patterns, you can control how the assertion messages are displayed. In the example, the pattern `['assert(value, [message])']` is used to format the assertion message.

const assert = require('assert');
const empower = require('empower-core');
const enhancedAssert = empower(assert, { patterns: ['assert(value, [message])'] });

function multiply(a, b) {
  return a * b;
}

const result = multiply(3, 3);
enhancedAssert(result === 10, 'Expected result to be 10');

Other packages similar to empower-core

Keywords

FAQs

Package last updated on 03 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc